package com.demo.service.impl;

import com.demo.dao.EmpDAO;
import com.demo.dao.impl.EmpDAOImpl;
import com.demo.service.EmpService;
import com.demo.vo.Emp;

import java.io.Serializable;
import java.util.Map;

/**
 * 员工模块的Service层（业务层）的具体实现类，对EmpService接口中定义的抽象方法作出具体的功能实现
 */
public class EmpServiceImpl implements EmpService {
    //@Override
    public void add(Emp vo) {
        EmpDAO empDAO = new EmpDAOImpl();
        empDAO.add(vo);
    }

    //@Override
    public void delete(long id) {
        EmpDAO empDAO = new EmpDAOImpl();
        empDAO.delete(id);
    }

    //@Override
    public void update(Emp vo) {
        EmpDAO empDAO = new EmpDAOImpl();
        empDAO.update(vo);
    }

    //@Override
    public Emp get(Serializable id) {
        EmpDAO empDAO = new EmpDAOImpl();
        return empDAO.get(id);
    }

    //@Override
    public Map<String, Object> list(Map<String, Object> params) {
        EmpDAO empDAO = new EmpDAOImpl();
        return empDAO.list(params);
    }
}
